package com.jxau.service;

import com.jxau.entity.User;
import com.jxau.entity.view.FollowerAndFansNum;
import com.jxau.entity.view.Liker;
import org.apache.ibatis.annotations.Param;

import javax.servlet.http.HttpSession;

import com.github.pagehelper.PageInfo;
import com.jxau.entity.User;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;


public interface UserService {
    /**
     * 登录业务
     * @param id
     * @param password
     * @param session
     * @return
     */
    Integer login(String id, String password, HttpSession session);
    String  queryHeadPhotoById(String id);
    /**
     * 取消点赞操作
     * @param articleId
     * @param uid
     */
    void doUnLike(Integer articleId,String uid);
    /**
     * 点赞操作
     * @param articleId
     * @param uid
     */
    void doLike(@Param("articleId") Integer articleId, @Param("uid") String uid);
    /**
     * 收藏操作
     * @param articleId
     * @param uid
     */
    void doCollect(@Param("articleId") Integer articleId,@Param("uid") String uid);
    /**
     * 取消收藏操作
     * @param articleId
     * @param uid
     */
    void doUnCollect(@Param("articleId") Integer articleId,@Param("uid") String uid);
    /**
     * 根据id查询用户信息
     * @param uid
     * @return
     */
    User queryUserById(String uid);

    //----------------------------------------------------------------------------
    /**
     * 取消点赞操作(评论)
     * @param commentId
     * @param uid
     */
    void doUnLikeForComment(Integer commentId,String uid);

    /**
     * 点赞操作(评论)
     * @param commentId
     * @param uid
     */
    void doLikeForComment(Integer commentId,String uid);
    /**
     * 根据uid查找用户所有信息
     * @param uid
     * @return
     */
    User queryUserInfoById(String uid);

    /**
     * 更新指定id的头像
     * @param uid
     * @param file
     */
    void updateHeadPhoto(String uid, MultipartFile file);

    /**
     * 更新指定id用户信息（不包含头像）
     * @param user
     */
    void updateUserInfo(User user);

    /**
     * 查询我的关注者们
     * @param uid
     * @return
     */
    ArrayList<User> queryFollowers(String uid);

    /**
     * 查询我的粉丝
     * @param uid
     * @return
     */
    ArrayList<User> queryFans(String uid);

    /**
     * 查询关注数和粉丝数
     * @param uid
     * @return
     */
    FollowerAndFansNum queryFollowerAndFansNum(String uid);

    /**
     * 查询当前用户是否关注指定用户
     * @param uid
     * @param otherUid
     * @return
     */
    Boolean queryIsFollow(String uid, String otherUid);

    //---------------------------------------------------------------------------------


    List<User> show();

    User findUserById(String id);

    List<User> findUserByName(String name);

    int updateUser(User user);

    int deleteUser(String id);

    List<User> getPages(int pageNum,int pageSize);

    PageInfo<User> getPagesData();

    int addUser(User user);

    User login(String id, String password);

    void cancelFollow(String uid, String otherUid);

    void followUser(String uid, String otherUid);

    Boolean register(String uid, String password, HttpSession session);

    Map<String, Integer> getNewCommentAndLikeNum(String uid);

    Map<String,Object> getNewLiker(String uid,int nowPage);

    void cleanRedPointOfLike(String uid);
}
